#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>


#include "kona-pmic-overlay.dtsi"
#include "kona-sde-display.dtsi"
#include "kona-audio-overlay.dtsi"
#include "kona-thermal-overlay.dtsi"
#include "kona-xr-pinctrl-overlay.dtsi"
#include "camera/kona-camera-sensor-xr.dtsi"

&tlmm {
	spkr_1_sd_n {
		spkr_1_sd_n_sleep: spkr_1_sd_n_sleep {
			mux {
				pins = "gpio127";
				function = "gpio";
			};

			config {
				pins = "gpio127";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;
				input-enable;
			};
		};

		spkr_1_sd_n_active: spkr_1_sd_n_active {
			mux {
				pins = "gpio127";
				function = "gpio";
			};

			config {
				pins = "gpio127";
				drive-strength = <16>;   /* 16 mA */
				bias-disable;
				output-high;
			};
		};
	};

	spkr_2_sd_n {
		spkr_2_sd_n_sleep: spkr_2_sd_n_sleep {
			mux {
				pins = "gpio129";
				function = "gpio";
			};

			config {
				pins = "gpio129";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;
				input-enable;
			};
		};

		spkr_2_sd_n_active: spkr_2_sd_n_active {
			mux {
				pins = "gpio129";
				function = "gpio";
			};

			config {
				pins = "gpio129";
				drive-strength = <16>;   /* 16 mA */
				bias-disable;
				output-high;
			};
		};
	};

	pri_aux_pcm_dout {
		pri_aux_pcm_dout_sleep: pri_aux_pcm_dout_sleep {
			mux {
				pins = "gpio7";
				function = "gpio";
			};

			config {
				pins = "gpio7";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		pri_aux_pcm_dout_active: pri_aux_pcm_dout_active {
			mux {
				pins = "gpio7";
				function = "mi2s0_data1";
			};

			config {
				pins = "gpio7";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
			};
		};
	};

	sec_aux_pcm_dout {
		sec_aux_pcm_dout_sleep: sec_aux_pcm_dout_sleep {
			mux {
				pins = "gpio6";
				function = "gpio";
			};

			config {
				pins = "gpio6";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		sec_aux_pcm_dout_active: sec_aux_pcm_dout_active {
			mux {
				pins = "gpio6";
				function = "mi2s0_data1";
			};

			config {
				pins = "gpio6";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
			};
		};
	};

	tert_aux_pcm {
		tert_aux_pcm_clk_sleep: tert_aux_pcm_clk_sleep {
			mux {
				pins = "gpio9";
				function = "gpio";
			};

			config {
				pins = "gpio9";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		tert_aux_pcm_clk_active: tert_aux_pcm_clk_active {
			mux {
				pins = "gpio9";
				function = "mi2s2_sck";
			};

			config {
				pins = "gpio9";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
				output-high;
			};
		};
	};

	tert_aux_pcm_din {
		tert_aux_pcm_din_sleep: tert_aux_pcm_din_sleep {
			mux {
				pins = "gpio8";
				function = "gpio";
			};

			config {
				pins = "gpio8";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		tert_aux_pcm_din_active: tert_aux_pcm_din_active {
			mux {
				pins = "gpio8";
				function = "mi2s2_data0";
			};

			config {
				pins = "gpio8";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
			};
		};
	};

	pri_tdm_dout {
		pri_tdm_dout_sleep: pri_tdm_dout_sleep {
			mux {
				pins = "gpio7";
				function = "gpio";
			};

			config {
				pins = "gpio7";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		pri_tdm_dout_active: pri_tdm_dout_active {
			mux {
				pins = "gpio7";
				function = "mi2s0_data1";
			};

			config {
				pins = "gpio7";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
			};
		};
	};

	sec_tdm_dout {
		sec_tdm_dout_sleep: sec_tdm_dout_sleep {
			mux {
				pins = "gpio6";
				function = "gpio";
			};

			config {
				pins = "gpio6";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		sec_tdm_dout_active: sec_tdm_dout_active {
			mux {
				pins = "gpio6";
				function = "mi2s1_data1";
			};

			config {
				pins = "gpio6";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
			};
		};
	};

	tert_tdm {
		tert_tdm_clk_sleep: tert_tdm_clk_sleep {
			mux {
				pins = "gpio9";
				function = "gpio";
			};

			config {
				pins = "gpio9";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		tert_tdm_clk_active: tert_tdm_clk_active {
			mux {
				pins = "gpio9";
				function = "mi2s2_sck";
			};

			config {
				pins = "gpio9";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
				output-high;
			};
		};
	};

	tert_tdm_din {
		tert_tdm_din_sleep: tert_tdm_din_sleep {
			mux {
				pins = "gpio8";
				function = "gpio";
			};

			config {
				pins = "gpio8";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		tert_tdm_din_active: tert_tdm_din_active {
			mux {
				pins = "gpio8";
				function = "mi2s2_data0";
			};

			config {
				pins = "gpio8";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
			};
		};
	};

	pri_mi2s_sd1 {
		pri_mi2s_sd1_sleep: pri_mi2s_sd1_sleep {
			mux {
				pins = "gpio7";
				function = "gpio";
			};

			config {
				pins = "gpio7";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		pri_mi2s_sd1_active: pri_mi2s_sd1_active {
			mux {
				pins = "gpio7";
				function = "mi2s2_data0";
			};

			config {
				pins = "gpio7";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
				output-high;
			};
		};
	};

	sec_mi2s_sd1 {
		sec_mi2s_sd1_sleep: sec_mi2s_sd1_sleep {
			mux {
				pins = "gpio6";
				function = "gpio";
			};

			config {
				pins = "gpio6";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		sec_mi2s_sd1_active: sec_mi2s_sd1_active {
			mux {
				pins = "gpio6";
				function = "mi2s1_data1";
			};

			config {
				pins = "gpio6";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
			};
		};
	};

	tert_mi2s_sck {
		tert_mi2s_sck_sleep: tert_mi2s_sck_sleep {
			mux {
				pins = "gpio9";
				function = "gpio";
			};

			config {
				pins = "gpio9";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		tert_mi2s_sck_active: tert_mi2s_sck_active {
			mux {
				pins = "gpio9";
				function = "mi2s2_sck";
			};

			config {
				pins = "gpio9";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
			};
		};
	};

	tert_mi2s_sd0 {
		tert_mi2s_sd0_sleep: tert_mi2s_sd0_sleep {
			mux {
				pins = "gpio8";
				function = "gpio";
			};

			config {
				pins = "gpio8";
				drive-strength = <2>;   /* 2 mA */
				bias-pull-down;         /* PULL DOWN */
				input-enable;
			};
		};

		tert_mi2s_sd0_active: tert_mi2s_sd0_active {
			mux {
				pins = "gpio8";
				function = "mi2s2_data0";
			};

			config {
				pins = "gpio8";
				drive-strength = <8>;   /* 8 mA */
				bias-disable;           /* NO PULL */
			};
		};
	};

	display_panel_led1_default: display_panel_led1_default {
		mux {
			pins = "gpio144";
			function = "gpio";
		};

		config {
			pins = "gpio144";
			drive-strength = <8>;
			bias-disable = <0>;
			output-high;
		};
	};

	display_panel_led2_default: display_panel_led2_default {
		mux {
			pins = "gpio140";
			function = "gpio";
		};

		config {
			pins = "gpio140";
			drive-strength = <8>;
			bias-disable = <0>;
			output-high;
		};
	};

};

&qupv3_se12_2uart {
	status = "ok";
};

&qupv3_se6_4uart {
	status = "ok";
};

&dai_mi2s2 {
	status = "ok";
	qcom,msm-mi2s-tx-lines = <1>;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&tert_mi2s_sck_active &tert_mi2s_ws_active
			&tert_mi2s_sd0_active>;
	pinctrl-1 = <&tert_mi2s_sck_sleep &tert_mi2s_ws_sleep
			&tert_mi2s_sd0_sleep>;
};

&kona_snd {
	qcom,model = "kona-xr-standalone-snd-card";
	qcom,msm-mi2s-master = <1>, <1>, <1>, <1>, <1>, <1>;
	qcom,wcn-bt = <1>;
	qcom,ext-disp-audio-rx = <1>;
	qcom,audio-routing =
		"AMIC1", "MIC BIAS1",
		"MIC BIAS1", "Analog Mic1",
		"AMIC2", "MIC BIAS2",
		"MIC BIAS2", "Analog Mic2",
		"AMIC3", "MIC BIAS3",
		"MIC BIAS3", "Analog Mic3",
		"AMIC4", "MIC BIAS3",
		"MIC BIAS3", "Analog Mic4",
		"AMIC5", "MIC BIAS4",
		"MIC BIAS4", "Analog Mic5",
		"DMIC0", "MIC BIAS1",
		"MIC BIAS1", "Digital Mic0",
		"DMIC1", "MIC BIAS1",
		"MIC BIAS1", "Digital Mic1",
		"DMIC2", "MIC BIAS1",
		"MIC BIAS1", "Digital Mic2",
		"DMIC3", "MIC BIAS1",
		"MIC BIAS1", "Digital Mic3",
		"DMIC4", "MIC BIAS4",
		"MIC BIAS4", "Digital Mic4",
		"DMIC5", "MIC BIAS4",
		"MIC BIAS4", "Digital Mic5",
		"DMIC6", "MIC BIAS3",
		"MIC BIAS3", "Digital Mic6",
		"DMIC7", "MIC BIAS3",
		"MIC BIAS3", "Digital Mic7",
		"IN1_HPHL", "HPHL_OUT",
		"IN2_HPHR", "HPHR_OUT",
		"IN3_AUX", "AUX_OUT",
		"TX SWR_ADC0", "ADC1_OUTPUT",
		"TX SWR_ADC1", "ADC2_OUTPUT",
		"TX SWR_ADC2", "ADC3_OUTPUT",
		"TX SWR_ADC3", "ADC4_OUTPUT",
		"TX SWR_DMIC0", "DMIC1_OUTPUT",
		"TX SWR_DMIC1", "DMIC2_OUTPUT",
		"TX SWR_DMIC2", "DMIC3_OUTPUT",
		"TX SWR_DMIC3", "DMIC4_OUTPUT",
		"TX SWR_DMIC4", "DMIC5_OUTPUT",
		"TX SWR_DMIC5", "DMIC6_OUTPUT",
		"TX SWR_DMIC6", "DMIC7_OUTPUT",
		"TX SWR_DMIC7", "DMIC8_OUTPUT",
		"WSA SRC0_INP", "SRC0",
		"WSA_TX DEC0_INP", "TX DEC0 MUX",
		"WSA_TX DEC1_INP", "TX DEC1 MUX",
		"RX_TX DEC0_INP", "TX DEC0 MUX",
		"RX_TX DEC1_INP", "TX DEC1 MUX",
		"RX_TX DEC2_INP", "TX DEC2 MUX",
		"RX_TX DEC3_INP", "TX DEC3 MUX",
		"SpkrLeft IN", "WSA_SPK1 OUT",
		"SpkrRight IN", "WSA_SPK2 OUT",
		"VA_AIF1 CAP", "VA_SWR_CLK",
		"VA_AIF2 CAP", "VA_SWR_CLK",
		"VA_AIF3 CAP", "VA_SWR_CLK",
		"VA MIC BIAS3", "Digital Mic0",
		"VA MIC BIAS3", "Digital Mic1",
		"VA MIC BIAS1", "Digital Mic2",
		"VA MIC BIAS1", "Digital Mic3",
		"VA MIC BIAS4", "Digital Mic4",
		"VA MIC BIAS4", "Digital Mic5",
		"VA DMIC0", "VA MIC BIAS3",
		"VA DMIC1", "VA MIC BIAS3",
		"VA DMIC2", "VA MIC BIAS1",
		"VA DMIC3", "VA MIC BIAS1",
		"VA DMIC4", "VA MIC BIAS4",
		"VA DMIC5", "VA MIC BIAS4",
		"VA SWR_ADC0", "VA_SWR_CLK",
		"VA SWR_ADC1", "VA_SWR_CLK",
		"VA SWR_ADC2", "VA_SWR_CLK",
		"VA SWR_ADC3", "VA_SWR_CLK",
		"VA SWR_MIC0", "VA_SWR_CLK",
		"VA SWR_MIC1", "VA_SWR_CLK",
		"VA SWR_MIC2", "VA_SWR_CLK",
		"VA SWR_MIC3", "VA_SWR_CLK",
		"VA SWR_MIC4", "VA_SWR_CLK",
		"VA SWR_MIC5", "VA_SWR_CLK",
		"VA SWR_MIC6", "VA_SWR_CLK",
		"VA SWR_MIC7", "VA_SWR_CLK",
		"VA SWR_ADC0", "ADC1_OUTPUT",
		"VA SWR_ADC1", "ADC2_OUTPUT",
		"VA SWR_ADC2", "ADC3_OUTPUT",
		"VA SWR_ADC3", "ADC4_OUTPUT",
		"VA SWR_MIC0", "DMIC1_OUTPUT",
		"VA SWR_MIC1", "DMIC2_OUTPUT",
		"VA SWR_MIC2", "DMIC3_OUTPUT",
		"VA SWR_MIC3", "DMIC4_OUTPUT",
		"VA SWR_MIC4", "DMIC5_OUTPUT",
		"VA SWR_MIC5", "DMIC6_OUTPUT",
		"VA SWR_MIC6", "DMIC7_OUTPUT",
		"VA SWR_MIC7", "DMIC8_OUTPUT";
	qcom,msm-mbhc-hphl-swh = <1>;
	qcom,msm-mbhc-gnd-swh = <1>;
	qcom,cdc-dmic01-gpios = <&cdc_dmic01_gpios>;
	qcom,cdc-dmic23-gpios = <&cdc_dmic23_gpios>;
	qcom,cdc-dmic45-gpios = <&cdc_dmic45_gpios>;
	asoc-codec  = <&stub_codec>, <&bolero>, <&ext_disp_audio_codec>;
	asoc-codec-names = "msm-stub-codec.1", "bolero_codec",
				"msm-ext-disp-audio-codec-rx";
	qcom,wsa-max-devs = <2>;
	qcom,wsa-devs = <&wsa881x_0211>, <&wsa881x_0212>,
			<&wsa881x_0213>, <&wsa881x_0214>;
	qcom,wsa-aux-dev-prefix = "SpkrLeft", "SpkrRight",
					"SpkrLeft", "SpkrRight";
	qcom,codec-max-aux-devs = <1>;
	qcom,codec-aux-devs = <&wcd938x_codec>;
	qcom,msm_audio_ssr_devs = <&audio_apr>, <&q6core>, <&lpi_tlmm>,
					<&bolero>;
};

&ufsphy_mem {
	compatible = "qcom,ufs-phy-qmp-v4";

	vdda-phy-supply = <&pm8150_l5>;
	vdda-phy-always-on;
	vdda-pll-supply = <&pm8150_l9>;
	vdda-phy-max-microamp = <89900>;
	vdda-pll-max-microamp = <18800>;

	status = "ok";
};

&ufshc_mem {
	vdd-hba-supply = <&ufs_phy_gdsc>;
	vdd-hba-fixed-regulator;
	vcc-supply = <&pm8150_l17>;
	vcc-voltage-level = <2504000 2950000>;
	vcc-low-voltage-sup;
	vccq-supply = <&pm8150_l6>;
	vccq2-supply = <&pm8150_s4>;
	vcc-max-microamp = <800000>;
	vccq-max-microamp = <800000>;
	vccq2-max-microamp = <800000>;

	qcom,vddp-ref-clk-supply = <&pm8150_l6>;
	qcom,vddp-ref-clk-max-microamp = <100>;

	status = "ok";
};

&pm8150a_l11 {
	qcom,init-voltage = <3304000>;
};


&vendor {
	kona_xr_batterydata: qcom,battery-data {
		qcom,batt-id-range-pct = <15>;
		#include "fg-gen4-batterydata-mlp466274-3650mah.dtsi"
		#include "fg-gen4-batterydata-atl466274-3650mah.dtsi"
	};
};


&pm8150a_amoled {
	status = "disabled";
};

&qupv3_se1_i2c {
	status = "disabled";
};

&pcie1 {
	status = "disabled";
};

&pcie2 {
	status = "disabled";
};

&soc {
	gpio_keys {
		compatible = "gpio-keys";
		label = "gpio-keys";

		pinctrl-names = "default";
		pinctrl-0 = <&key_home_default
			&key_vol_up_default>;

		home {
			label = "home";
			gpios = <&pm8150_gpios 7 GPIO_ACTIVE_LOW>;
			linux,input-type = <1>;
			linux,code = <KEY_BACK>;
			gpio-key,wakeup;
			debounce-interval = <15>;
			linux,can-disable;
		};

		vol_up {
			label = "volume_up";
			gpios = <&pm8150_gpios 6 GPIO_ACTIVE_LOW>;
			linux,input-type = <1>;
			linux,code = <KEY_VOLUMEUP>;
			gpio-key,wakeup;
			debounce-interval = <15>;
			linux,can-disable;
		};
	};

	qcom,qbt_handler {
		status = "disabled";
	};

	qcom,xr-stdalonevwr-misc {
		compatible = "qcom,xr-stdalonevwr-misc";
	};
};

&qupv3_se13_i2c {
	#address-cells = <1>;
	#size-cells = <0>;

	status = "disabled";

	st_fts@49 {
		status = "disabled";
	};
};

&qupv3_se15_i2c {
	#address-cells = <1>;
	#size-cells = <0>;

	halo,hl6111r@25 {
		compatible = "halo,hl6111r";
		reg = <0x25>;
		status = "disabled";
	};
};

&vendor {
	bluetooth: bt_qca6390 {
		compatible = "qca,qca6390";
		pinctrl-names = "default";
		pinctrl-0 = <&bt_en_sleep>;
		qca,bt-reset-gpio = <&tlmm 21 0>; /* BT_EN */
		qca,bt-vdd-aon-supply = <&pm8150_s6>;
		qca,bt-vdd-dig-supply = <&pm8009_s2>;
		qca,bt-vdd-rfa1-supply = <&pm8150_s5>;
		qca,bt-vdd-rfa2-supply = <&pm8150a_s8>;
		qca,bt-vdd-asd-supply = <&pm8150_l16>;

		qca,bt-vdd-aon-voltage-level = <950000 950000>;
		qca,bt-vdd-dig-voltage-level = <950000 952000>;
		qca,bt-vdd-rfa1-voltage-level = <1900000 1900000>;
		qca,bt-vdd-rfa2-voltage-level = <1350000 1350000>;
		qca,bt-vdd-asd-voltage-level = <3024000 3304000>;

		qca,bt-vdd-asd-current-level = <10000>;
	};

	extcon_usb1: extcon_usb1 {
		compatible = "linux,extcon-usb-gpio";
		vbus-gpio = <&pm8150_gpios 10 GPIO_ACTIVE_HIGH>;
		id-gpio = <&tlmm 91 GPIO_ACTIVE_HIGH>;
		vbus-out-gpio = <&pm8150_gpios 9 GPIO_ACTIVE_HIGH>;

		pinctrl-names = "default";
		pinctrl-0 = <&usb2_vbus_det_default
			     &usb2_id_det_default
			     &usb2_vbus_boost_default>;
	};
};

&vreg_hap_boost {
	status = "ok";
};

&pm8150b_haptics {
	vdd-supply = <&vreg_hap_boost>;
};

&pm8150b_vadc {
	#address-cells = <1>;
	#size-cells = <0>;

	vph_pwr@83 {
		reg = <ADC_VPH_PWR>;
		label = "vph_pwr";
		qcom,pre-scaling = <1 3>;
	};

	conn_therm@4f {
		reg = <ADC_AMUX_THM3_PU2>;
		label = "conn_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	chg_sbux@99 {
		reg = <ADC_SBUx>;
		label = "chg_sbux";
		qcom,pre-scaling = <1 3>;
	};

	mid_chg_div6@1e {
		reg = <ADC_MID_CHG_DIV6>;
		label = "chg_mid";
		qcom,pre-scaling = <1 6>;
	};

	usb_in_i_uv@7 {
		reg = <ADC_USB_IN_I>;
		label = "usb_in_i_uv";
		qcom,pre-scaling = <1 1>;
	};

	usb_in_v_div_16@8 {
		reg = <ADC_USB_IN_V_16>;
		label = "usb_in_v_div_16";
		qcom,pre-scaling = <1 16>;
	};
};

&pm8150b_charger {
	status = "ok";
	qcom,sec-charger-config = <0>;
	qcom,auto-recharge-soc = <98>;
	io-channels = <&pm8150b_vadc ADC_MID_CHG_DIV6>,
		      <&pm8150b_vadc ADC_USB_IN_I>,
		      <&pm8150b_vadc ADC_SBUx>,
		      <&pm8150b_vadc ADC_VPH_PWR>,
		      <&pm8150b_vadc ADC_CHG_TEMP>;
	io-channel-names = "mid_voltage",
			   "usb_in_current",
			   "sbux_res",
			   "vph_voltage",
			   "chg_temp";
	qcom,battery-data = <&kona_xr_batterydata>;
	qcom,step-charging-enable;
	qcom,sw-jeita-enable;
	qcom,wd-bark-time-secs = <16>;
	qcom,suspend-input-on-debug-batt;
	qcom,fcc-stepping-enable;
};

&pm8150b_fg {
	status = "ok";
	qcom,battery-data = <&kona_xr_batterydata>;
	qcom,hold-soc-while-full;
	qcom,linearize-soc;
	qcom,five-pin-battery;
	qcom,cl-wt-enable;
	qcom,soc-scale-mode-en;
	/* ESR fast calibration */
	qcom,fg-esr-timer-chg-fast = <0 7>;
	qcom,fg-esr-timer-dischg-fast = <0 7>;
	qcom,fg-esr-timer-chg-slow = <0 96>;
	qcom,fg-esr-timer-dischg-slow = <0 96>;
	qcom,fg-esr-cal-soc-thresh = <26 230>;
	qcom,fg-esr-cal-temp-thresh = <10 40>;
};

&qupv3_se15_i2c {
	#address-cells = <1>;
	#size-cells = <0>;
#include "smb1390.dtsi"

	halo,hl6111r@25 {
		compatible = "halo,hl6111r";
		reg = <0x25>;
		status = "ok";
	};
};

&smb1390 {
	pinctrl-names = "default";
	pinctrl-0 = <&smb_stat_default>;
	status = "ok";
};

&smb1390_charger {
	io-channels = <&pm8150b_vadc ADC_AMUX_THM2>;
	io-channel-names = "cp_die_temp";
};

&pm8150_vadc {
	#address-cells = <1>;
	#size-cells = <0>;

	vph_pwr@83 {
		reg = <ADC_VPH_PWR>;
		label = "vph_pwr";
		qcom,pre-scaling = <1 3>;
	};

	vcoin@85 {
		reg = <ADC_VCOIN>;
		label = "vcoin";
		qcom,pre-scaling = <1 3>;
	};

	xo_therm@4c {
		reg = <ADC_XO_THERM_PU2>;
		label = "xo_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	skin_therm@4d {
		reg = <ADC_AMUX_THM1_PU2>;
		label = "skin_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	pa_therm1@4e {
		reg = <ADC_AMUX_THM2_PU2>;
		label = "pa_therm1";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};
};

&pm8150l_vadc {
	#address-cells = <1>;
	#size-cells = <0>;

	vph_pwr@83 {
		reg = <ADC_VPH_PWR>;
		label = "vph_pwr";
		qcom,pre-scaling = <1 3>;
	};

	camera_flash_therm@4d {
		reg = <ADC_AMUX_THM1_PU2>;
		label = "camera_flash_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	skin_msm_therm@4e {
		reg = <ADC_AMUX_THM2_PU2>;
		label = "skin_msm_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	pa_therm2@4f {
		reg = <ADC_AMUX_THM3_PU2>;
		label = "pa_therm2";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};
};

&pm8150b_adc_tm {
	#address-cells = <1>;
	#size-cells = <0>;

	io-channels = <&pm8150b_vadc ADC_AMUX_THM3_PU2>;

	conn_therm@4f {
		reg = <ADC_AMUX_THM3_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};
};

&pm8150_adc_tm {
	#address-cells = <1>;
	#size-cells = <0>;

	io-channels = <&pm8150_vadc ADC_XO_THERM_PU2>,
			<&pm8150_vadc ADC_AMUX_THM1_PU2>,
			<&pm8150_vadc ADC_AMUX_THM2_PU2>;

	xo_therm@4c {
		reg = <ADC_XO_THERM_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	skin_therm@4d {
		reg = <ADC_AMUX_THM1_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	pa_therm1@4e {
		reg = <ADC_AMUX_THM2_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};
};

&pm8150l_adc_tm {
	#address-cells = <1>;
	#size-cells = <0>;

	camera_flash_therm@4d {
		reg = <ADC_AMUX_THM1_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	skin_msm_therm@4e {
		reg = <ADC_AMUX_THM2_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	pa_therm2@4f {
		reg = <ADC_AMUX_THM3_PU2>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};
};

&spmi_debug_bus {
	status = "ok";
};

&dsi_dual_xrsmrtvwr_jdi_video {
	qcom,panel-supply-entries = <&dsi_panel_pwr_supply_lab_ibb>;
	qcom,mdss-dsi-bl-pmic-control-type = "bl_ctrl_external";
	qcom,mdss-dsi-bl-min-level = <1>;
	qcom,mdss-dsi-bl-max-level = <4095>;
	qcom,mdss-brightness-max-level = <255>;
	qcom,platform-reset-gpio = <&tlmm 75 0>;
	qcom,platform-te-gpio = <&tlmm 66 0>;

	qcom,platform-bklight-en-gpio = <&tlmm 133 0>;
	qcom,5v-boost-gpio = <&tlmm 134 0>;
	/delete-property/ qcom,platform-en-gpio;
};

&sde_dsi {
	avdd-supply = <&display_panel_avdd>;
	lab-supply = <&lcdb_ldo_vreg>;
	ibb-supply = <&lcdb_ncp_vreg>;
	qcom,dsi-default-panel = <&dsi_dual_xrsmrtvwr_jdi_video>;
};

&display_panel_avdd {
	display_panel_led1_gpio = <&tlmm 144 0>;
	display_panel_led2_gpio = <&tlmm 140 0>;
	enable-active-high;
	regulator-boot-on;
	pinctrl-names = "default";
	pinctrl-0 = <&display_panel_led1_default
			 &display_panel_led2_default>;
};

&dsi_panel_pwr_supply_lab_ibb {
	qcom,panel-supply-entry@3 {
		reg = <1>;
		qcom,supply-name = "avdd";
		qcom,supply-min-voltage = <4600000>;
		qcom,supply-max-voltage = <6000000>;
		qcom,supply-enable-load = <100000>;
		qcom,supply-disable-load = <100>;
	};
};

&pm8150l_lcdb {
	status = "ok";
};

&pm8150l_wled {
	status = "ok";
};

&thermal_zones {
	conn-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm8150b_adc_tm ADC_AMUX_THM3_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	xo-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm8150_adc_tm ADC_XO_THERM_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	skin-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm8150_adc_tm ADC_AMUX_THM1_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	mmw-pa1-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm8150_adc_tm ADC_AMUX_THM2_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	camera-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm8150l_adc_tm ADC_AMUX_THM1_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	skin-msm-therm-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm8150l_adc_tm ADC_AMUX_THM2_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	mmw-pa2-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pm8150l_adc_tm ADC_AMUX_THM3_PU2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};
};

&sdhc_2 {
	vdd-supply = <&pm8150a_l9>;
	qcom,vdd-voltage-level = <2950000 2960000>;
	qcom,vdd-current-level = <200 800000>;

	vdd-io-supply = <&pm8150_s4>;
	qcom,vdd-io-voltage-level = <1808000 2960000>;
	qcom,vdd-io-current-level = <200 22000>;

	pinctrl-names = "active", "sleep";
	pinctrl-0 = <&sdc2_clk_on  &sdc2_cmd_on &sdc2_data_on &storage_cd>;
	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &storage_cd>;

	cd-gpios = <&tlmm 77 GPIO_ACTIVE_LOW>;

	status = "ok";
};

&usb1 {
	extcon = <&extcon_usb1>;
};

&flash_led {
	qcom,hw-strobe-option = <0>;
	qcom,strobe-sel = <1>;
};

&pm8150l_flash0 {
	qcom,hw-strobe-option = <0>;
	qcom,strobe-sel = <1>;
};

&pm8150l_flash1 {
	qcom,hw-strobe-option = <0>;
	qcom,strobe-sel = <1>;
};

&pm8150l_flash2 {
	qcom,hw-strobe-option = <0>;
	qcom,strobe-sel = <1>;
};

&pm8150l_torch0 {
	qcom,hw-strobe-option = <0>;
	qcom,strobe-sel = <1>;
};

&pm8150l_torch1 {
	qcom,hw-strobe-option = <0>;
	qcom,strobe-sel = <1>;
};

&pm8150l_torch2 {
	qcom,hw-strobe-option = <0>;
	qcom,strobe-sel = <1>;
};

&wil6210 {
	status = "disabled";
};

&key_home_default {
	pins = "gpio7";
};
